﻿
/* 
 * Since 2008 - 2012
 */
package com.hh.bss.project.entity;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;

import com.hh.bss.base.*;
import com.hh.bss.common.page.*;
import com.hh.bss.common.page.impl.*;
import com.hh.bss.project.dao.*;
import com.hh.bss.project.entity.*;
import com.hh.bss.project.service.*;
import com.hh.bss.project.vo.query.*;
import com.hh.bss.util.*;





public class ContractJobAttachment extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "ContractJobAttachment";
	public static final String ALIAS_ID = "id";
	public static final String ALIAS_JOB_ID = "jobId";
	public static final String ALIAS_NAME = "name";
	public static final String ALIAS_FILE_NAME = "fileName";
	public static final String ALIAS_FILE_TYPE = "fileType";
	public static final String ALIAS_FILE_SIZE = "fileSize";
	public static final String ALIAS_REMARK = "remark";
	public static final String ALIAS_CREATOR = "creator";
	public static final String ALIAS_CREATE_DT = "createDt";
	
	//date formats
	public static final String FORMAT_CREATE_DT = DATE_FORMAT;
	
	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
	
	private java.lang.Integer id;
	@NotNull 
	private java.lang.Integer jobId;
	@NotBlank @Length(max=100)
	private java.lang.String name;
	@NotBlank @Length(max=200)
	private java.lang.String fileName;
	@Length(max=20)
	private java.lang.String fileType;
	
	private java.lang.Integer fileSize;
	@Length(max=500)
	private java.lang.String remark;
	@Length(max=50)
	private java.lang.String creator;
	
	private java.util.Date createDt;
	//columns END

	public ContractJobAttachment(){
	}

	public ContractJobAttachment(
		java.lang.Integer id
	){
		this.id = id;
	}

	public void setId(java.lang.Integer value) {
		this.id = value;
	}
	
	public java.lang.Integer getId() {
		return this.id;
	}
	public void setJobId(java.lang.Integer value) {
		this.jobId = value;
	}
	
	public java.lang.Integer getJobId() {
		return this.jobId;
	}
	public void setName(java.lang.String value) {
		this.name = value;
	}
	
	public java.lang.String getName() {
		return this.name;
	}
	public void setFileName(java.lang.String value) {
		this.fileName = value;
	}
	
	public java.lang.String getFileName() {
		return this.fileName;
	}
	public void setFileType(java.lang.String value) {
		this.fileType = value;
	}
	
	public java.lang.String getFileType() {
		return this.fileType;
	}
	public void setFileSize(java.lang.Integer value) {
		this.fileSize = value;
	}
	
	public java.lang.Integer getFileSize() {
		return this.fileSize;
	}
	public void setRemark(java.lang.String value) {
		this.remark = value;
	}
	
	public java.lang.String getRemark() {
		return this.remark;
	}
	public void setCreator(java.lang.String value) {
		this.creator = value;
	}
	
	public java.lang.String getCreator() {
		return this.creator;
	}
	public String getCreateDtString() {
		return DateConvertUtils.format(getCreateDt(), FORMAT_CREATE_DT);
	}
	public void setCreateDtString(String value) {
		setCreateDt(DateConvertUtils.parse(value, FORMAT_CREATE_DT,java.util.Date.class));
	}
	
	public void setCreateDt(java.util.Date value) {
		this.createDt = value;
	}
	
	public java.util.Date getCreateDt() {
		return this.createDt;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("JobId",getJobId())
			.append("Name",getName())
			.append("FileName",getFileName())
			.append("FileType",getFileType())
			.append("FileSize",getFileSize())
			.append("Remark",getRemark())
			.append("Creator",getCreator())
			.append("CreateDt",getCreateDt())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof ContractJobAttachment == false) return false;
		if(this == obj) return true;
		ContractJobAttachment other = (ContractJobAttachment)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

